import React, { Component } from 'react';
import QuickNavigation from './components/QuickNavigation';
import OverviewChart from './components/OverviewChart';
import ChartPie from "./components/ChartPie/ChartPie";
import Sortable from "./components/SortableTable";
import Sortable1 from "./components/SortableTable1";
import cookie from 'react-cookies';
import axios from 'axios';
import { Grid } from '@icedesign/base';

const { Row, Col } = Grid;


export default class Home extends Component {
  static displayName = 'Home';

  constructor(props) {
    super(props);
    this.state = {};
  }
  componentDidMount() {
    // const username = this.props.location.state.username;
    // console.log(username);
    // console.log('**',cookie.load('user'))
    // console.log('*^*',cookie.load('user') !== 'asd');
    // const test = this.props.location.state;
    // console.log(test);
    // const baseurl = 'http://39.105.21.199:8989/IPEvaluation/evaluateManage/userShowEvaluateList.do?sessionId=';
    // const sessionid = cookie.load('sessionId');
    // axios.post(baseurl + sessionid).then((response) => {
    //   console.log(response.data.data);
    //   console.log(response.data.msg);
    //   const msg = response.data.msg;
    //   console.log('eqewq')
    //   if (msg === 'LoginInvalidate') {
    //     this.props.history.push('/pagelogin');
    //   }
    // }).catch((error) => {
    //   console.log(error);
    // });
  }
  render() {
    return (
      <div className="home-page">
        {/*<QuickNavigation />*/}
        <OverviewChart history={this.props.history} />
        <div>
          <Row wrap gutter="20">
            <Col l="12">
              <Sortable />
            </Col>
            <Col l="12">
              <Sortable1 />
            </Col>
          </Row>
        </div>
        <ChartPie />
      </div>
    );
  }
}
